package com.lzy.product.service.impl;

import com.lzy.framework.core.utils.DozerUtils;
import com.lzy.product.dao.AgentOrderProjectRecordMapperExt;
import com.lzy.product.dtos.agent.AgentOrderProjectRecordDto;
import com.lzy.product.entity.AgentOrderProjectRecord;
import com.lzy.product.service.AgentOrderProjectRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by WIN7 on 2018/4/17.
 */
@Service
public class AgentOrderProjectRecordServiceImpl implements AgentOrderProjectRecordService {
    @Autowired
    AgentOrderProjectRecordMapperExt agentOrderProjectRecordMapperExt;

    @Override
    public List<AgentOrderProjectRecordDto> selectAgentOrderProjectRecordByOrderId(Long orderId) {
        return agentOrderProjectRecordMapperExt.selectAgentOrderProjectRecordByOrderId(orderId);
    }

    @Override
    public Boolean insert(AgentOrderProjectRecordDto agentOrderProjectRecordDto) {
        return agentOrderProjectRecordMapperExt.insertSelective(DozerUtils.map(agentOrderProjectRecordDto, AgentOrderProjectRecord.class)) > 0;
    }
}
